//
//  EquipmentRepairDetController.m
//  PropertyMananger
//
//  Created by bh on 17/2/8.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "EquipmentRepairDetController.h"
#import "EquipmentRepairDetailCell.h"
#import "DescribeCell.h"


@interface EquipmentRepairDetController ()
/**标题数据源**/
@property (nonatomic,strong) NSArray * mTitleArr;
/**信息详细数据源**/
@property (nonatomic,strong) NSArray * mInfoArr;
@end

@implementation EquipmentRepairDetController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initTitleViewName:@"设备检修详情"];
    
    [self initTableViewWithView:self.view frame:CGRectMake(0, 0, BHscreenW, BHscreenH - 64) isGroup:NO];
    self.tableView.backgroundColor = BHGrayColor;
    
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 7;
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    EquipmentRepairDetailCell * cell = [EquipmentRepairDetailCell cellWithTableView:tableView];
    
    
   if(indexPath.row == 0){
    cell.nameLabel.text = @"设备编号:";
    cell.titleLabel.text = [NSString stringWithFormat:@"%@",self.model.EquipmentNumber];
    }else if (indexPath.row == 1){
        cell.nameLabel.text = @"设备名称:";
        cell.titleLabel.text = self.model.EquipmentName;
    }else if (indexPath.row == 2){
        cell.nameLabel.text = @"规格型号:";
        cell.titleLabel.text = self.model.SpecificationModel;
    }else if (indexPath.row == 3){
        cell.nameLabel.text = @"检  修  人:";
        cell.titleLabel.text = self.model.MaintenanceMan;
    }else if (indexPath.row == 4){
        cell.nameLabel.text = @"安装地址:";
        cell.titleLabel.text = self.model.InstallationAddress;
    }else if (indexPath.row == 5){
    
        DescribeCell * cell = [DescribeCell cellWithTableView:tableView];
        cell.titleLabel.text = @"检修内容";
        cell.infoLabel.text = self.model.MaintenanceCSontent;
        return cell;
        
    }else if (indexPath.row == 6){
    
        DescribeCell * cell = [DescribeCell cellWithTableView:tableView];
        cell.titleLabel.text = @"检修情况";
        cell.infoLabel.text = self.model.MaintenanceCondition;
        return cell;
    }

    return cell;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
   
    if (indexPath.row >= 0 && indexPath.row <= 4) {
    
        return 45;
        
    }else if (indexPath.row == 5){
    
        return [DescribeCell cellEquipRepairContentHeightWiht:self.model];
        
    }else if (indexPath.row == 6){
    
        return [DescribeCell cellEquipRepairConditionHeightWiht:self.model];
    }
    return 0;
}


@end
